package system_code.IO;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;

public class Test5 {
    public static void main(String[] args) throws IOException {
        File f = new File("test.txt");
        //打开文件
        InputStream input = new FileInputStream("test.txt");
        while(true){
            int ascii = input.read();//返回文本中字母的ascii码
            if(ascii == -1){//ascii等于-1时，说明读完了
                break;
            }
            char ch = (char)ascii;
            System.out.print(ch);
        }
        //关闭文件(保存文件)
        input.close();
    }
}
